Task References

On this page:

toLocaleUpperCase

Purpose

The toLocaleUpperCase task is used to convert a string value to uppercase according to locale-specific case mappings. The locale is based on the language settings of the browser. For most languages this task will function exactly like the toUpperCase task and produce the same output; however, certain languages may behave differently (e.g. case mappings for Turkish do not follow the default case mappings in Unicode).

Potential Use Case

Suppose you have a dataset in lowercase format and you want to display it in uppercase. You could use the toLocaleUpperCase task to convert the entire dataset to uppercase characters.

Properties

Input and output parameters are shown below.

Incoming Type Description
str String Required. The string to convert to uppercase.
locale String The locale to be used to convert to uppercase according to any locale-specific case mappings.


Outgoing Type Description
uppercaseString String A new string representing the value of the incoming string converted to uppercase according to the current locale.

Example

In this example the str is given the Reference variable of "hello world" in lowercase letters. The locale variable would be populated only if it was a language such as Turkish, which needs specific letters to be capitalized for meaning.

toLocaleUppercase

The outgoing result shows that all of the letters from the incoming Reference variable are now uppercase and display as "HELLO WORLD".

toLocaleUppercaseResult

Additional Information

For more information see the Locale page on the MDN site.